<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('查看监督日志')" />
    <th:block th:include="include :: datetimepicker-css" />
    <base target="_self" />
    <style>
        .x-form-title{
            background:eeeeee;
            text-align:right;
            color:navy;
            filter1:DropShadow(Color=#ffffe1, OffX=1, OffY=1, Positive=2);
            font-size: 13px;
            font-weight: bold;
            border: 1px solid #B5B8C8;
        }
        .x-form-text{
            padding: 1px 3px;
            background:#fff repeat-x 0 0;
            border: 1px solid #B5B8C8;
        }
    </style>
</head>
<body class="gray-bg">
<form class="form-horizontal m" id="form-auditDaylogQuery-edit" th:object="${wtCheckDaylog}">
    <div class="form-group">
        <div class="col-md-12">
            <span style="color:green;font-size:16px;">查看监控日志</span>
            <div style="float: right;margin-right: 10px;">
                <button type="button" class="btn btn-sm btn-success" onclick="do_check()"><i class="fa fa-check"></i>审核</button>&nbsp;
                <button type="button" class="btn btn-sm btn-danger" onclick="_doBackAudit()"><i class="fa fa-upload"></i>退回</button>&nbsp;
                <button type="button" class="btn btn-sm btn-primary" onclick="_downLoad()"><i class="fa fa-download"></i>下载</button>&nbsp;
                <a class="btn btn-warning" onclick="window.returnValue=false;window.close();">
                    <i class="fa fa-close"></i> 关闭
                </a>
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-12">
            <!--<input type="hidden" name="flag" id="flag"/>-->
            <input type="hidden" id="id" name="id" th:field="*{id}"/>
            <table align="center" width="100%" id="checkDayLogTable">
                <tr>
                    <td colspan="3" align="center"><h3>监控日志</h3></td>
                </tr>
                <tr>
                    <td  class="x-form-text" bgcolor="#ffffff" width="30%" >
                        <div align="left">
                            日期：<span th:text="${#dates.format(wtCheckDaylog.workDate,'yyyy-MM-dd')}"></span>
                            <input type="hidden" id="workDate" name="workDate" th:value="${#dates.format(wtCheckDaylog.workDate,'yyyy-MM-dd')}" >
                        </div>
                    </td>
                    <td  class="x-form-text" bgcolor="#ffffff" width="35%" align="left">
                        <div align="left">记录人：<span th:text="*{createOper}"></span>
                            <input type="hidden" id="createOper" th:field="*{createOper}">
                        </div>
                    </td>
                    <td  class="x-form-text"  bgcolor="#ffffff" width="35%" align="left">
                        <div align="left">所在机构：<span th:text="*{brCode}"></span></div>
                    </td>
                </tr>
                <tr>
                    <td  class="x-form-title" colspan="3" >
                        <div align="center">日结管理</div>
                    </td>
                </tr>
                <tr>
                    <td  class="x-form-title">
                        <div align="right">重点监控预警量：</div>
                    </td>
                    <td  class="x-form-text" colspan="1">
                        <div id="divAUDIT_NUM" align="left"><span th:text="*{auditNum}"></span></div>
                    </td>
                    <td  class="x-form-text" colspan="1">
                        <div id="" align="left"></div>
                        <a class="btn btn-success btn-sm" onclick="auditView()">查看详细</a>
                    </td>
                </tr>
                <tr>
                    <td  class="x-form-title">
                        <!--<div align="right">被监控机构、柜员信息：</div>-->
                        <div align="right">被监控机构信息：</div>
                    </td>
                    <td  class="x-form-text" colspan="2">
                        <div id="divWORK_DESC8" align="left"><span th:text="*{workDesc8}"></span></div>
                    </td>
                </tr>
                <!--<tr>
                    <td  class="x-form-title">
                        <div align="right">ARMS预警核销量：</div>
                    </td>
                    <td  class="x-form-text" colspan="2">
                        <div id="divARMS_NUM" align="left"><input type="text" th:field="*{armsNum}"></div>
                    </td>
                </tr>
                <tr>
                    <td  class="x-form-title">
                        <div align="right">OCR督办量：</div>
                    </td>
                    <td  class="x-form-text" colspan="2">
                        <div id="divOCR_NUM" align="left"><input type="text" th:field="*{ocrNum}"></div>
                    </td>
                </tr>-->
                <tr>
                    <td  class="x-form-title">
                        <div align="right">重点监控下发督办量：</div>
                    </td>
                    <td  class="x-form-text" colspan="1">
                        <div id="divRESTORE_NUM" align="left"><span th:text="*{restoreNum}"></span></div>
                    </td>
                    <td class="x-form-text">
                        <a class="btn btn-success btn-sm" onclick="registErrView()">查看详细</a>
                    </td>
                </tr>

                <tr>
                    <td  class="x-form-title">
                        <div align="right">处理督办次数：</div>
                    </td>
                    <td  class="x-form-text" colspan="1">
                        <div id="divERR_NUM" align="left"><span th:text="*{errNum}"></span></div>
                    </td>
                    <td class="x-form-text">
                        <a class="btn btn-success btn-sm" onclick="dealErrView()">查看详细</a>
                    </td>
                </tr>
                <tr>
                    <td  class="x-form-title">
                        <div align="right">随机抽查量：</div>
                    </td>
                    <td  class="x-form-text" colspan="1">
                        <div id="divRANDOMAUDIT_NUM" align="left"><span th:text="*{randomauditNum}"></span></div>
                    </td>
                    <td class="x-form-text">
                        <a class="btn btn-success btn-sm" onclick="RANDOMAUDITView()">查看详细</a>
                    </td>
                </tr>
                <tr>
                    <td  class="x-form-title">
                        <div align="right">人工选择监督量：</div>
                    </td>
                    <td  class="x-form-text" colspan="1">
                        <div id="divMANUAUDIT_NUM" align="left">
                            <span th:text="*{manuauditNum}"></span>
                        </div>
                    </td>
                    <td class="x-form-text">
                        <a class="btn btn-success btn-sm" onclick="MANUAUDITView()">查看详细</a>
                    </td>
                </tr>
                <tr>
                    <td  class="x-form-title">
                        <div align="right">质量检查量：</div>
                    </td>
                    <td  class="x-form-text" colspan="1">
                        <div id="divREAUDIT_NUM" align="left">
                            <span th:text="*{reauditNum}"></span>
                        </div>
                    </td>
                    <td class="x-form-text">
                        <a class="btn btn-success btn-sm" onclick="REAUDIT_NUMView()">查看详细</a>
                    </td>
                </tr>
                <tr>
                    <td  class="x-form-title">
                        <div align="right">集中预警量：</div>
                    </td>
                    <td  class="x-form-text" colspan="1">
                        <div id="divRISK_NUM" align="left">
                            <span th:text="*{riskNum}"></span>
                        </div>
                    </td>
                    <td class="x-form-text">
                        <a class="btn btn-success btn-sm" onclick="RISK_NUMView()">查看详细</a>
                    </td>
                </tr>
                <tr>
                    <td  class="x-form-title" colspan="3" align="center">
                        <div align="center">工作情况</div>
                    </td>
                </tr>

                <tr>
                    <td  class="x-form-title" >
                        情况反馈：
                    </td>
                    <td  class="x-form-text" bgcolor="ffffff" colspan="2">
						<textarea objFlag="true"  nameDesc="情况反馈" readonly="readonly"
                                  name="workDesc1" style="width: 99%; height: 80px"
                                  canHasCNChar="true" canBeNull="false" dataType="String" th:field="*{workDesc1}"></textarea>
                    </td>
                </tr>
                <tr>
                    <td  class="x-form-title" >
                        审批意见：
                    </td>
                    <td  class="x-form-text" bgcolor="ffffff" colspan="2">
						<textarea objFlag="true"  nameDesc="审批意见"
                                  id="workDesc2" name="workDesc2" style="width: 99%; height: 80px"
                                  th:readonly="${wtCheckDaylog.auditStatus==1}"
                                  canHasCNChar="true" canBeNull="false" dataType="String" th:field="*{workDesc2}"></textarea>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "wt/auditDaylogQuery";

        $("#form-auditDaylogQuery-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-auditDaylogQuery-edit').serialize());
            }
        }

        $("input[name='workDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='createDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

    //原js函数
        function do_check(){
            var wtCheckDaylog =  [[${wtCheckDaylog}]];
            if(wtCheckDaylog &&  wtCheckDaylog.auditStatus== 1){
                alert('已经审核，不需要再次审核！');
                return false;
            }
            if (confirm("是否审核？")){
                var data = $('#form-auditDaylogQuery-edit').serialize();
                $.operate.post(prefix + "/auditing",data,function (action) {
                    alert(action.msg);
                    window.returnValue = true;
                    window.close();
                });
            }
        }
        function _doBackAudit(){
            var wtCheckDaylog =  [[${wtCheckDaylog}]];
            if(wtCheckDaylog &&  wtCheckDaylog.auditStatus== 1){
                alert('已经审核，不能回退！');
                return false;
            }
            if (confirm("是否回退？")){
                var data = $('#form-auditDaylogQuery-edit').serialize();
                $.operate.post(prefix + "/auditingBack",data,function (action) {
                    alert(action.msg);
                    window.returnValue = true;
                    window.close();
                });
            }
        }
        function _downLoad(){
            var daylog =  [[${wtCheckDaylog}]];
            var id = daylog.id;
            var status = daylog.state;
            if(status != 1){
                alert('未提交，不能下载');
                return false;
            }
            var data = $('#form-auditDaylogQuery-edit').serialize();
            $.operate.post(prefix + "/downLoad",data,function (result) {
                //alert(result.msg);
                if (result.code == web_status.SUCCESS) {
                    window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
                } else if (result.code == web_status.WARNING) {
                    $.modal.alertWarning(result.msg)
                } else {
                    $.modal.alertError(result.msg);
                }
                $.modal.closeLoading();
            });
        }
        function auditView(){
            var id = $("#id").val();
            var url=prefix+"/showAudit4View/{id}";
            url = url.replace("{id}",id);
            window.showModalDialog(url,"","dialogWidth=1024px; dialogHeight=600px; help=no; status=no; scroll=yes; resizable=no;");
        }
        function RANDOMAUDITView(){
            if($("#divRANDOMAUDIT_NUM").text()==""){
                alert("没有要查看的详情！");
                return;
            }
            var createOper = $("#createOper").val();
            var workDate = $("#workDate").val();
            var url=ctx + "wt/auditDaylogQuery/showRandomAudit4View/{workDate}/{createOper}";
            url = url.replace("{workDate}",workDate).replace("{createOper}",createOper);
            if(window.showModalDialog) {
                var obj = window.showModalDialog(url,window,"dialogWidth=1024px; dialogHeight=600px; help=no; status=no; scroll=yes; resizable=no;");
            }
        }
        function MANUAUDITView(){
            if($("#divRANDOMAUDIT_NUM").text()==""){
                alert("没有要查看的详情！");
                return;
            }
            var createOper = $("#createOper").val();
            var workDate = $("#workDate").val();
            var url=ctx + "wt/auditDaylogQuery/showManAudit4View/{workDate}/{createOper}";
            url = url.replace("{workDate}",workDate).replace("{createOper}",createOper);
            if(window.showModalDialog) {
                var obj = window.showModalDialog(url,window,"dialogWidth=1024px; dialogHeight=600px; help=no; status=no; scroll=yes; resizable=no;");
            }
        }
        //质量检查
        function REAUDIT_NUMView() {
            var createOper = $("#createOper").val();
            var workDate = $("#workDate").val();
            var url=ctx + "wt/auditDaylogQuery/showReAudit4View/{workDate}/{createOper}";
            url = url.replace("{workDate}",workDate).replace("{createOper}",createOper);
            if(window.showModalDialog) {
                var obj = window.showModalDialog(url,window,"dialogWidth=1024px; dialogHeight=600px; help=no; status=no; scroll=yes; resizable=no;");
            }
        }
        //重点监控下发督办
        function registErrView(){
            var createOper = $("#createOper").val();
            var workDate = $("#workDate").val();
            var url=ctx + "wt/auditDaylogQuery/showRegistErrView/{workDate}/{createOper}";
            url = url.replace("{workDate}",workDate).replace("{createOper}",createOper);
            if(window.showModalDialog) {
                var obj = window.showModalDialog(url,window,"dialogWidth=1024px; dialogHeight=600px; help=no; status=no; scroll=yes; resizable=no;");
            }
        }
        //处理督办
        function dealErrView(){
            var createOper = $("#createOper").val();
            var workDate = $("#workDate").val();
            var url=ctx + "wt/auditDaylogQuery/showDealErrView/{workDate}/{createOper}";
            url = url.replace("{workDate}",workDate).replace("{createOper}",createOper);
            if(window.showModalDialog) {
                var obj = window.showModalDialog(url,window,"dialogWidth=1024px; dialogHeight=600px; help=no; status=no; scroll=yes; resizable=no;");
            }
        }
        //集中预警
        function  RISK_NUMView(){
            if($("#divRISK_NUM").text()==""){
                alert("没有要查看的详情！");
                return;
            }
            var createOper = $("#createOper").val();
            var workDate = $("#workDate").val();
            //var url = "paeaCheckDayLog.do?method=queryAll3%26createTime="+workDate+"%26errRegOper="+createOper+"%26errorGrade="+'-1';
            var url=ctx + "wt/auditDaylogQuery/showRiskErrView/{workDate}/{createOper}";
            url = url.replace("{workDate}",workDate).replace("{createOper}",createOper);
            if(window.showModalDialog) {
                var obj = window.showModalDialog(url,window,"dialogWidth=1024px; dialogHeight=600px; help=no; status=no; scroll=yes; resizable=no;");
            }
        }
    </script>
</body>
</html>